/*
 * @Author: DUST
 * @Date: 2023-11-26 11:11:48
 * @LastEditors: DUST
 * @LastEditTime: 2024-01-20 11:18:14
 * @FilePath: \business-card-system\server\app\validator\CompanyValidator.ts
 * @Description: 
 * undefined
 */

import { Rules } from "async-validator";

export interface CompanyItem  {
  name: string;
  desName?: string;
  desName1?: string;
  desName3?: string;
  video?: string;
  addr: string;
  addr2: string;
  lng: string;
  lat: string;
  imgs: string;
  swippers: string;
  unitId: number;
  id?: number;
}

class CompanyValidator {
  private _addRules: Rules = {
    name: [
      {
        type: "string",
        required: true,
        message: "请输入公司名称"
      }
    ],
    addr: [
      {
        type: "string",
        required: true,
        message: "请输入公司地址"
      }
    ],
    addr2: [
      {
        type: "string",
        required: true,
        message: "请输入公司地址2"
      }
    ],
    lng: [
      {
        type: "string",
        required: true,
        message: "经度缺失"
      }
    ],
    lat: [
      {
        type: "string",
        required: true,
        message: "纬度缺失"
      }
    ]
  }
  public get addRules() : Rules {
    return this._addRules;
  }
  private _editRules: Rules = {
    name: [
      {
        type: "string",
        required: true,
        message: "请输入公司名称"
      }
    ],
    addr: [
      {
        type: "string",
        required: true,
        message: "请输入公司地址"
      }
    ],
    addr2: [
      {
        type: "string",
        required: true,
        message: "请输入公司地址2"
      }
    ],
    lng: [
      {
        type: "string",
        required: true,
        message: "经度缺失"
      }
    ],
    lat: [
      {
        type: "string",
        required: true,
        message: "纬度缺失"
      }
    ]
  }
  public get editRules() : Rules {
    return this._editRules;
  }
}

export default new CompanyValidator;